package com.wsx.first.c;


import java.util.*;

/**
 * @author: wangshunxi
 * @date: 2022/5/10 16:22
 * @Description:
 */
public class Main0051 {
    public static class ListNode{
        public ListNode next;
        public Integer value;
    }

    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            while (scanner.hasNext()) {
                in(scanner);
            }

        }
    }

    private static void in(Scanner scanner) {
        Integer count = Integer.valueOf(scanner.nextLine());
        String content = scanner.nextLine();
        String[] split = content.split(" ");
        ListNode head = null;
        ListNode p = null;
        for (int i = 0; i < split.length; i++) {
            ListNode current= new ListNode();
            current.value = Integer.valueOf(split[i]);
            if (p == null) {
                head = current;
            } else {
                p.next = current;
            }
            p = current;
        }
        String idx = scanner.nextLine();
        solution(head, Integer.valueOf(idx));
    }

    private static void solution(ListNode head, Integer count) {

        ListNode fast = head;
        ListNode slow = head;
        for (int i = 0; i < count-1; i++) {
            fast = fast.next;
        }
        while (fast.next != null) {
            fast = fast.next;
            slow = slow.next;
        }
        System.out.println(slow.value);
    }


}
